home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / 1105.zip / 1105.TXT next >
Text File  |  1993-03-08  |  9KB  |  305 lines

  1.                                    FYI
  2.  
  3. (Note: The origin of this information may be internal or external
  4. to Novell.  Novell makes every effort within its means to verify
  5. this information.  However, the information provided in this
  6. document is FOR YOUR INFORMATION only.  Novell makes no explicit
  7. or implied claims to the validity of this information.)
  8.  
  9.           TITLE: SAMPLES OF DR DOS ENHANCEMENTS IN CONFIG AND
  10.                   BATCH PROCESSING
  11.    DOCUMENT ID#: FYI-M-1105
  12.            DATE: 03MAR93
  13.         PRODUCT: DR DOS
  14. PRODUCT VERSION: 6.0
  15.      SUPERSEDES: FYI-M-1113
  16.  
  17.         SYMPTOM: SAMPLES OF POSSIBLE DR DOS CONFIGURATION FILES
  18.  
  19.   ISSUE/PROBLEM: DR DOS has greatly enhanced CONFIG and BATCH
  20. commands. This document provides examples of how these various
  21. commands can be used. 
  22.  
  23.        Solution: Only the basic ideas are outlined in each
  24. example. The rest of the file can be filled in with your own
  25. ideas.
  26.  
  27.  
  28.      EXAMPLE 1 - The use of GOTO in the CONFIG file.
  29.  
  30. ?"Do you want to run QEMM (y/n)? " goto QEMM
  31. ?"Do you want to run MemoryMAX (y/n)? " goto DRDOS
  32.  
  33. :QEMM
  34. DEVICE=c:\QTR_DECK\QEMM386.SYS
  35. DEVICE=C:\DRDOS\HIDOS.SYS /B=FFFF
  36. (additional QEMM driver lines go here...)
  37. goto COMMON
  38.  
  39. :DRDOS
  40. hidos=on
  41. DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO...
  42. ...
  43.  
  44. :COMMON
  45. files=40
  46. hibuffers=20
  47. ...
  48.  
  49. The GOTO statement is used to proceed directly to a label. This
  50. function works like the GOTO statement found in batch file
  51. processing. 
  52.  
  53.      EXAMPLE 2 - The use of CHAIN in the CONFIG file. 
  54.  
  55. This example shows that you can link to other files that hold
  56. your configurations for each system setup. In the following
  57. CONFIG.SYS file, the two lines direct the configuration process
  58. to the files: QCONFIG and MCONFIG.SYS. The appropriate FILES,
  59. BUFFERS, etc. information is contained within those files and not
  60. within the main CONFIG.SYS file. If the response to both
  61. questions is no, a default configuration begins. The RETURN
  62. command cannot be used to return to the parent CONFIG file.
  63.  
  64. ?"Do you want to run QEMM (y/n)? " chain=QCONFIG.SYS
  65. ?"Do you want to run MemoryMAX (y/n)? " chain=MCONFIG.SYS
  66. files=40
  67. hibuffers=20
  68. ...
  69.  
  70.  
  71.      EXAMPLE 3 - Using SWITCH/RETURN and labels. 
  72.  
  73. Processing pauses on the SWITCH command until an option is
  74. chosen. The appropriate option is selected by choosing a number.
  75. The SWITCH command then goes to the corresponding label. In the
  76. example below 1 selects the label :NOLIM, 2 selects the label
  77. :512K and so forth. The RETURN command will return processing to
  78. the line after SWITCH. Notice the use of the ECHO statement for
  79. setting up the menu options.
  80.  
  81. ECHO =        Choose how much Extended Memory you want to convert
  82. ECHO =            to LIM Memory for this session. 
  83. ECHO =
  84. ECHO =          1 (or ENTER)    No LIM Memory
  85. ECHO =          2               512K of Memory
  86. ECHO =          3               1024K of Memory
  87. ECHO =          4               2048K of Memory
  88. ECHO =
  89. ECHO =         Make your selection...
  90.  
  91. SWITCH NOLIM, 512K, 1024K, 2048K
  92. GOTO DEFAULTS
  93.  
  94. :NOLIM
  95. DEVICE=C:\DRDOS\EMM386.SYS /F=NONE /K=AUTO /B=FFFF /R=AUTO RETURN
  96.  
  97. :512K
  98. DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO /K=512 /B=FFFF /R=AUTO
  99. RETURN
  100.  
  101. :1024K
  102. DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO /K=1024 /B=FFFF /R=AUTO RETURN
  103.  
  104. :2048K
  105. DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO /K=2048 /B=FFFF /R=AUTO RETURN
  106. :DEFAULTS
  107. SHELL=C:\COMMAND.COM \C: /P /E:512
  108. HIDOS=ON
  109. HIBUFFERS=20
  110. FILES=30
  111. etc...
  112.  
  113.  
  114.      EXAMPLE 4 - How to use environment variables in the CONFIG
  115.  
  116. The use of variables in the CONFIG is not quite the same as in
  117. batch files. Because the command processor (COMMAND.COM) is not
  118. loaded until after CONFIG processing, environment variables are
  119. only stored. These variables are then passed to the command
  120. processor where they can be tested and processed through the
  121. AUTOEXEC.BAT or other batch files. It is not possible to test an
  122. environment variable in the CONFIG. The CLS, CPOS, EXIT and SET
  123. commands are featured in this example.
  124.  
  125. :DEFAULTS
  126. SHELL=C:\COMMAND.COM \C: /P /E:512
  127. HIDOS=ON
  128. HIBUFFERS=20
  129. FILES=30
  130. etc....
  131.  
  132. ECHO =         Choose which TSRs and Utilities you want loaded 
  133. ECHO =               at BOOT time for this session. 
  134. ECHO =
  135. ECHO =         1 (or ENTER)   None... just continue
  136. ECHO =         2              Mouse & Cursor Drivers
  137. ECHO =         3              Keyboard "Speeder"
  138. ECHO =         4              Novell Network
  139. ECHO =         5              Done with selections
  140. ECHO =
  141. ECHO =         Make your selection...
  142.  
  143. :MORE
  144. CPOS 10,33
  145. SWITCH NOTHING, CURSMOUS, SPEEDKEY, NOVELL, DONE
  146. GOTO MORE
  147.  
  148. :DONE
  149. :NOTHING
  150. CLS
  151. EXIT
  152.  
  153. :CURSMOUS
  154. SET THINGS=ON
  155. RETURN
  156.  
  157. :SPEEDKEY
  158. SET SPEEDKEY=ON
  159. RETURN
  160.  
  161. :NOVELL
  162. SET NETWORK=ON
  163. RETURN
  164.  
  165. The AUTOEXEC.BAT shown below picks up the environment variables. 
  166.  
  167. The AUTOEXEC.BAT file now allows testing of the environment
  168. variables and executes commands based upon the conditionals
  169. illustrated below:
  170.  
  171. @ECHO OFF
  172. :drdosbeg
  173. VERIFY OFF
  174. PATH C:\;C:\DRDOS;C:\BATS;C:\TOOLS;C:\WINDOWS
  175. if "%things%"=="on" prompt $e[s$e[0;70H$e[1;36m$t$e[u$e[1;36mDR   
  176.      DOS6$p$g$e[2;32m
  177. if not "%things%"=="on" PROMPT [DR DOS] $P$G
  178. SET TEMP=C:\TEMP
  179. IF NOT "%TEMP%"=="" MD %TEMP% >NUL
  180. if "%things%"=="on" HILOAD MOUSE
  181. if "%things%"=="on" HILOAD CURSOR /s10
  182. if "%speedkey%"=="on" c:\drdos\mode con:rate=30 delay=1
  183. if "%network%"=="on" hiload c:\lan\ipx
  184. if "%network%"=="on" hiload c:\lan\net3
  185. :drdosend
  186.  
  187.  
  188. OTHER EXAMPLES
  189. 1) Selecting different configuration options from the CONFIG.SYS
  190.    file using the ? key.
  191.  
  192. ?SHELL=C:\COMMAND.COM C:\ /P /E:512
  193. ?SHELL=C:\COMMAND.COM C:\ /P /E:1024
  194. ?BREAK=OFF
  195. ?BREAK=ON
  196. BUFFERS=20
  197. FILES=20
  198. ?HISTORY=ON, 256, ON, OFF, OFF
  199. ?DEVICE=C:\DRDOS\ANSI.SYS
  200.  
  201. 2) Selecting different AUTOEXEC.BAT's from CONFIG.SYS using the ?
  202.    and the Shell statement. 
  203.  
  204. In the Shell statement the /P switch can be followed by a
  205. filename. When present, the named file will be executed instead
  206. of the AUTOEXEC.BAT. The named file must have a .BAT extension
  207. and cannot exceed 11 characters including path.
  208.  
  209. ?"Default Autoexec? (y/n) "SHELL=C:\COMMAND.COM C:\ /P /E:256
  210. ?"Alternate Autoexec? (y/n) "SHELL=C:\COMMAND.COM C:\
  211.         /P:ALTERNAT.BAT /E:256
  212.  
  213. 3) Selecting and using different configuration files from
  214.    CONFIG.SYS at bootup.
  215.  
  216. ?"Do you want to run Windows? (y/n) " chain = WCONFIG.SYS
  217. ?"Do you want to use QEMM? (y/n) " chain = QCONFIG.SYS
  218. ?"Do you want to use MemoryMAX? (y/n) " chain = MCONFIG.SYS
  219. ?"Do you want to use 386MAX? (y/n) " chain = 386CONF.SYS
  220.  
  221. Each line is printed on the screen and you are asked to load/run
  222. the chained configuration file. Each configuration file is a
  223. complete CONFIG.SYS type file with all of the appropriate
  224. options.
  225.  
  226. 4) The above configuration using "menu" choices with SWITCH. 
  227.  
  228. Note how the "SET environment" variables can be used and tested
  229. for different AUTOEXEC type files in this example.
  230.  
  231. CONFIG.SYS
  232.  
  233. ECHO =    1  For Windows Configuration
  234. ECHO =    2  For QEMM Configuration
  235. ECHO =    3  For DR DOS MemoryMAX Configuration
  236. ECHO =    4  For 386MAX Configuration
  237. ECHO =    5  For no Configuration... just exit
  238. SWITCH win, qemm, memm, 386m, none
  239. :none
  240.  
  241. set autoexec=norm
  242. exit
  243.  
  244. :win
  245. set autoexec=win
  246. chain=wconfig.sys
  247.  
  248. :qemm
  249. set autoexec=qemm
  250. chain=qconfig.sys
  251.  
  252. :memm
  253. set autoexec=memm
  254. chain=mconfig.sys
  255.  
  256. :386m
  257. set autoexec=386m
  258. chain=386conf.sys
  259.  
  260. AUTOEXEC.BAT 
  261.  
  262. @echo off
  263. PATH C:\DRDOS;C:\;C:\UTIL;
  264. VERIFY OFF
  265. PROMPT $P$G
  266. DISKMAP C: D: 
  267. IF "%autoexec%"=="norm" goto DRDOSEXIT
  268. SHARE /L:40
  269. IF "%autoexec%"=="win" SUPERPCK /EM /L:2048
  270. IF "%autoexec%"=="qemm" CALL QEMM.BAT
  271. IF "%autoexec%"=="memm" SUPERPCK  /A /L:2048
  272. IF "%autoexec%"=="386m" CALL 386.BAT
  273. :DRDOSEXIT
  274.  
  275. 5) Using ANSI
  276.  
  277. ANSI escape sequences can be used in batch file processing to
  278. create colorful menus. Below is an example of a menu that uses
  279. the SWITCH command and ANSI escape sequences to create a menu.
  280. ANSI.SYS must be loaded in the CONFIG.SYS to allow for cursor
  281. positioning and colors. The first character after the Echo
  282. statement is an ASCII 27 or escape character. This character may
  283. be displayed differently on some printers and monitors (in fact
  284. if you have ANSI loaded you will never see the character when
  285. typed to the screen). To type this character using the DR DOS
  286. Editor type CTRL-P then the ESC key. An alternate method is to
  287. type CTRL_Q N and then type the number 27. Within Editor the ESC
  288. character will appear as: ^[ . If you have downloaded this
  289. document from CompuServe or the Novell Host System the escape
  290. sequences have been left intact and you can use the DR DOS Editor
  291. to block out the Echo statements to a file. Then, if ANSI is
  292. loaded when the file is typed to the screen you should see white
  293. letters on a magenta background.  
  294.  
  295. For additional information on ANSI.SYS and escape sequences refer
  296. to page 399 of the DR DOS Users Guide.
  297.  
  298. @ECHO OFF
  299. ECHO   ┌─────────────────────────────────┐
  300. ECHO   │      1. CONTINUE W/O SCAN       │█
  301. ECHO   │      2. SCAN FOR VIRUSES        │█
  302. ECHO   └─────────────────────────────────┘█
  303. ECHO    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  304. SWITCH MENUBEGIN,SCAN
  305.